﻿<%@ Page Language="C#" MasterPageFile="~/admin/adminMasterPage.master" AutoEventWireup="true" CodeFile="category.aspx.cs" Inherits="admin_category_category" Title="无标题页" %>

<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
        
        <asp:GridView ID="category_gridview" runat="server" AutoGenerateColumns="False" CellPadding="4"
        ForeColor="#333333" GridLines="None" Width="909px" 
        DataSourceID="ObjectDataSource1" onrowcommand="category_gridview_RowCommand"
    >
        <FooterStyle BackColor="#990000" Font-Bold="true" ForeColor="White" />
        <Columns>
             <asp:TemplateField HeaderText="编号">
                <ItemTemplate>
                    <asp:Label ID="Label5" Text="<%#Container.DataItemIndex + 1%>" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="categoryName_cn" HeaderText="类别中文名" />
            <asp:BoundField DataField="categoryName_en" HeaderText="类别英文名" />
            <asp:BoundField DataField="belongName" HeaderText="所属大类"  ReadOnly="true"/>
            <asp:BoundField DataField="categoryDate" HeaderText="添加时间" ReadOnly="true"/>  
            <asp:TemplateField HeaderText="操作" ItemStyle-CssClass="op">
                <ItemTemplate>
                    <asp:Button ID="deleteButton" runat="server"
                        CommandName="deleteCategory" 
                        CommandArgument='<%#Eval("categoryId") %>'
                        Text="删除"
                        CssClass="button"
                         BorderColor="Transparent"
                         BorderStyle="None"
                       />
                    <asp:Button ID="editButton" runat="server"
                        CommandName="editCategory" 
                        CommandArgument='<%#Eval("categoryId") %>'
                        Text="编辑"
                        CssClass="button"
                        BorderColor="Transparent"
                        BorderStyle="None"
                       />      
                </ItemTemplate>
            </asp:TemplateField>        
        </Columns>
    </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            SelectMethod="getAllCategory" TypeName="DB"></asp:ObjectDataSource>
</asp:Content>

